package com.linln.modules.userule.domain;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Map;


/**
 * @author : pengliang
 * @version V1.0
 * @Project: timo
 * @Package com.linln.modules.userule.domain
 * @Descriptio /**
 * @Project: timo
 * @Package com.linln.modules.userule.domain
 * @Description: TODO
 * @date Date : 2020年12月29日 11:44
 */

@TableName(value = "tbl_use_rule")
public class UseRule {
    @TableId(value = "use_rule_id", type = IdType.UUID)
    private String useRuleId;

    /**
     * 规则名称
     */
    @TableField(value = "use_rule_name")
    private String useRuleName;

    /**
     * 规则描述
     */
    @TableField(value = "use_rule_describe")
    private String useRuleDescribe;

    /**
     * 创建时间
     */
    @TableField(value = "use_rule_create_date")
    private String useRuleCreateDate;

    /**
     * 创建时间
     */
    @TableField(value = "can_delete")
    private Boolean canDelete;

    /**
     * json
     */
    @TableField(value = "use_rule_props")
    @JsonIgnore
    private String useRuleProps;

    //序列化这个方法
    @JsonGetter("useRuleProps")
    public Map<String, String> getJsonUseRuleProps() {
        return JSON.parseObject(useRuleProps, Map.class);
    }

    public static final String COL_USE_RULE_ID = "use_rule_id";

    public static final String COL_USE_RULE_NAME = "use_rule_name";

    public static final String COL_USE_RULE_DESCRIBE = "use_rule_describe";

    public static final String COL_USE_RULE_CREATE_DATE = "use_rule_create_date";

    public static final String COL_USE_RULE_PROPS = "use_rule_props";

    /**
     * @return use_rule_id
     */
    public String getUseRuleId() {
        return useRuleId;
    }

    /**
     * @param useRuleId
     */
    public void setUseRuleId(String useRuleId) {
        this.useRuleId = useRuleId;
    }

    /**
     * 获取规则名称
     *
     * @return use_rule_name - 规则名称
     */
    public String getUseRuleName() {
        return useRuleName;
    }

    /**
     * 设置规则名称
     *
     * @param useRuleName 规则名称
     */
    public void setUseRuleName(String useRuleName) {
        this.useRuleName = useRuleName;
    }

    /**
     * 获取规则描述
     *
     * @return use_rule_describe - 规则描述
     */
    public String getUseRuleDescribe() {
        return useRuleDescribe;
    }

    /**
     * 设置规则描述
     *
     * @param useRuleDescribe 规则描述
     */
    public void setUseRuleDescribe(String useRuleDescribe) {
        this.useRuleDescribe = useRuleDescribe;
    }

    /**
     * 获取创建时间
     *
     * @return use_rule_create_date - 创建时间
     */
    public String getUseRuleCreateDate() {
        return useRuleCreateDate;
    }

    /**
     * 设置创建时间
     *
     * @param useRuleCreateDate 创建时间
     */
    public void setUseRuleCreateDate(String useRuleCreateDate) {
        this.useRuleCreateDate = useRuleCreateDate;
    }

    /**
     * 获取json
     *
     * @return use_rule_props - json
     */
    public String getUseRuleProps() {
        return useRuleProps;
    }

    /**
     * 设置json
     *
     * @param useRuleProps json
     */
    public void setUseRuleProps(String useRuleProps) {
        this.useRuleProps = useRuleProps;
    }


    public Boolean getCanDelete() {
        return canDelete;
    }

    public void setCanDelete(Boolean canDelete) {
        this.canDelete = canDelete;
    }
}
